﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EQT.Dal;
using System.Threading;

public partial class PaginationTest : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = 10;
            bind();
        }

    }
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        Thread.Sleep(3000);
        bind();

    }
    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        //AspNetPager1.CurrentPageIndex = e.NewPageIndex;
    }

    protected void bind()
    {
        int count = 0;

        GridView1.DataSource = DaCommon.GetPaginationData("select * from Employee",
        10, AspNetPager1.CurrentPageIndex - 1, "Emp_ID desc", out count);
        GridView1.DataBind();

        AspNetPager1.RecordCount = count;
    }
}
